
import { handleActions } from "redux-actions";
import { GET_ADD_CART_DATA } from "../types";
import _ from "lodash";

const initData = {
  user: {},
  seckill: {},
  count: 1
}

export const add_shoppingCart = handleActions({
  // 将传入的值存储到状态机
  [GET_ADD_CART_DATA]: (state, { payload }) => {
    console.log(payload);
    return _.assign({}, state, payload);
    // const { user, seckill } = payload;
    // return _.assign({}, state, {
    //   user,
    //   seckill
    // });
  }
}, initData);